import { createI18n } from "vue-i18n";
import en from "./en";
import zn from "./zn";
const messages={
   en:{
      ...en
   },
   zn:{
      ...zn
   }
}
// /**  @returns (string)*/
function getlocal(){
   const mylocal=localStorage.getItem('language')
   if (mylocal) {
      return mylocal
   }
   const localName=navigator.language.indexOf('zh')!==-1?'zh':'en'
   localStorage.setItem('language',localName)
   return localName
}
export const i18n=createI18n({
   legacy:false,
   locale:getlocal(),
   messages
})